Skip to content

test: Batch 각 Step 단위 테스트 검증#43

Merged
tkv00 merged 8 commits intodevelopfrom
test/#19
Dec 17, 2025
Merged

test: Batch 각 Step 단위 테스트 검증#43
tkv00 merged 8 commits intodevelopfrom
test/#19

Conversation

@tkv00
Copy link
Contributor

@tkv00 tkv00 commented Dec 16, 2025

🍀 이슈 번호


✅ 작업 사항

  • 각 step별로 단위 테스트 검증
  • SnapshotDocument의 복합 id인 SnapshotId의 오버라이딩 메서드 테스트 검증
  • ProblemJdbcRepository 벌크성 업데이트 쿼리 테스트 검증

⌨ 기타

@tkv00 tkv00 added the ✅ test 테스트 코드 추가/수정 label Dec 16, 2025
@tkv00 tkv00 linked an issue Dec 16, 2025 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @tkv00, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 배치 처리 로직의 견고성을 높이기 위해 광범위한 단위 테스트를 도입합니다. 사용자 정보 로딩, Solved.ac API 호출, 스냅샷 로딩 및 저장, 사용자 티어 및 문제 변경 감지 등 배치 작업의 핵심 구성 요소들이 개별적으로 검증됩니다. 이를 통해 배치 시스템의 안정성과 정확성이 향상될 것으로 기대됩니다.

Highlights

  • 배치 스텝 단위 테스트 추가: 배치 처리의 각 스텝(LoadAllUsersTasklet, FetchSolvedAcUserInfoTasklet, LoadSnapshotTasklet, DetectAndUpdateUserTierAndProblemTasklet, SaveSnapshotTasklet)에 대한 단위 테스트가 추가되었습니다.
  • SnapshotId 복합 ID 테스트: SnapshotDocument의 복합 ID인 SnapshotId 클래스의 equals() 및 hashCode() 메서드 동작을 검증하는 테스트가 추가되었습니다.
  • ProblemJdbcRepository 벌크 업데이트 테스트: ProblemJdbcRepository의 벌크성 업데이트 쿼리(batchInsertProblems)에 대한 테스트가 추가되어 중복 처리 로직을 검증합니다.
  • 환경 설정 및 .gitignore 업데이트: MongoDB URI 환경 변수명이 MONGO_URL에서 MONGO_URI로 변경되었고, /logs/* 디렉토리가 .gitignore에 추가되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 PR은 배치 작업의 각 단계에 대한 포괄적인 단위 테스트를 추가하여 테스트 커버리지와 안정성을 크게 향상시켰습니다. 테스트는 구조가 잘 잡혀 있으며 성공 케이스, 엣지 케이스, 실패 조건 등 다양한 시나리오를 다루고 있습니다. 코드 정리 및 테스트 헬퍼의 작은 버그와 관련된 몇 가지 개선 영역을 발견했습니다. 전반적으로 테스트 스위트를 강화하는 훌륭한 작업입니다!

import java.util.Set;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

사용되지 않는 Assertions import 문입니다. 코드를 깔끔하게 유지하기 위해 제거하는 것이 좋습니다.

Comment on lines +8 to +18
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.scope.context.StepContext;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.repeat.RepeatStatus;
import store.slackjudge.batch.config.BatchLogger;
import store.slackjudge.batch.infra.mongo.document.UserSolvedSnapShotDocument;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

사용되지 않는 import 문들(ArgumentCaptor, UserSolvedSnapShotDocument)이 있습니다. 코드를 깔끔하게 유지하기 위해 제거하는 것이 좋습니다.

@sonarqubecloud
Copy link

@tkv00 tkv00 merged commit 8b7e787 into develop Dec 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ test 테스트 코드 추가/수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

배치 테스트 코드 작성 (Service / Step / Job 단위)

1 participant